// 留言板页面组件样式
@use '../variables' as *;
.guestbook-page {
    min-height: 100vh;
    background-color: #f8fafc;
}

// 主要内容区域样式
.main-content {
    padding-top: 64px;
    min-height: calc(100vh - 64px);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

// 页面头部区域样式
.hero-section {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    .hero-content {
        position: relative;
        z-index: 2;
    }
    .hero-title {
        font-size: 3.5rem;
        font-weight: $font-bold;
        color: $text-primary;
        margin: 0 0 20px 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        animation: fadeInUp 1s ease-out;
    }
    .hero-subtitle {
        font-size: 1.25rem;
        color: $text-secondary;
        margin: 0;
        line-height: 1.6;
        animation: fadeInUp 1s ease-out 0.2s both;
    }
    .hero-decoration {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        .floating-bubble {
            position: absolute;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            animation: float 6s ease-in-out infinite;
            &.bubble-1 {
                width: 60px;
                height: 60px;
                top: 20%;
                left: 10%;
                animation-delay: 0s;
            }
            &.bubble-2 {
                width: 40px;
                height: 40px;
                top: 60%;
                right: 15%;
                animation-delay: 2s;
            }
            &.bubble-3 {
                width: 80px;
                height: 80px;
                bottom: 20%;
                left: 20%;
                animation-delay: 4s;
            }
        }
    }
}

// 留言统计区域样式
.stats-section {
    margin-bottom: 60px;
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 24px;
    }
    .stat-card {
        background: white;
        border-radius: $radius-lg;
        padding: 32px 24px;
        box-shadow: $shadow-md;
        border: 1px solid $border-light;
        transition: all $transition-normal;
        display: flex;
        align-items: center;
        gap: 20px;
        &:hover {
            transform: translateY(-4px);
            box-shadow: $shadow-lg;
            border-color: rgba($accent-color, 0.2);
        }
        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            flex-shrink: 0;
        }
        .stat-content {
            flex: 1;
            .stat-number {
                font-size: 2rem;
                font-weight: $font-bold;
                color: $text-primary;
                margin: 0 0 4px 0;
                line-height: 1;
            }
            .stat-label {
                color: $text-secondary;
                font-size: 14px;
                margin: 0;
            }
        }
    }
}

// 留言表单区域样式
.comment-form-section {
    margin-bottom: 60px;
    .form-container {
        background: white;
        border-radius: $radius-lg;
        padding: 40px;
        box-shadow: $shadow-md;
        border: 1px solid $border-light;
        .form-header {
            text-align: center;
            margin-bottom: 32px;
            .user-avatar {
                width: 80px;
                height: 80px;
                border-radius: 50%;
                overflow: hidden;
                margin: 0 auto;
                box-shadow: $shadow-md;
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }
        .comment-form {
            .form-row {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 24px;
                margin-bottom: 24px;
                @media (max-width: 768px) {
                    grid-template-columns: 1fr;
                    gap: 20px;
                }
            }
            .form-field {
                margin-bottom: 24px;
                label {
                    display: block;
                    font-weight: $font-medium;
                    color: $text-primary;
                    margin-bottom: 8px;
                    font-size: 14px;
                }
                .el-input {
                    .el-input__wrapper {
                        border-radius: $radius-md;
                        transition: all $transition-normal;
                        &:hover {
                            border-color: rgba($accent-color, 0.3);
                        }
                        &.is-focus {
                            border-color: $accent-color;
                            box-shadow: 0 0 0 2px rgba($accent-color, 0.1);
                        }
                    }
                    &.error .el-input__wrapper {
                        border-color: #f56c6c;
                        box-shadow: 0 0 0 2px rgba(245, 108, 108, 0.1);
                    }
                }
                .error-message {
                    color: #f56c6c;
                    font-size: 12px;
                    margin-top: 4px;
                    display: block;
                }
            }
            .form-actions {
                text-align: center;
                margin-top: 32px;
                .submit-btn {
                    padding: 12px 32px;
                    font-size: 16px;
                    border-radius: $radius-md;
                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                    border: none;
                    color: white;
                    font-weight: $font-medium;
                    transition: all $transition-normal;
                    &:hover {
                        transform: translateY(-2px);
                        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
                    }
                    &:active {
                        transform: translateY(0);
                    }
                }
            }
        }
    }
}

// 留言展示区域样式
.comments-section {
    .comments-container {
        // 示例数据提示样式
        .sample-data-notice {
            margin-bottom: 24px;
            
            .el-alert {
                border-radius: $radius-lg;
                border: 1px solid rgba($accent-color, 0.2);
                background: linear-gradient(135deg, rgba($accent-color, 0.05) 0%, rgba($accent-color, 0.02) 100%);
                
                .el-alert__title {
                    font-weight: $font-semibold;
                    color: $accent-color;
                }
                
                .el-alert__description {
                    color: $text-secondary;
                    font-size: 14px;
                    line-height: 1.5;
                }
                
                .el-alert__icon {
                    color: $accent-color;
                }
            }
        }

        // 加载状态样式
        .loading-state {
            text-align: center;
            padding: 80px 20px;
            background: white;
            border-radius: $radius-lg;
            box-shadow: $shadow-md;
            border: 1px solid $border-light;
            .loading-icon {
                font-size: 48px;
                color: $accent-color;
                margin-bottom: 16px;
                animation: spin 1s linear infinite;
            }
            p {
                color: $text-secondary;
                font-size: 16px;
                margin: 0;
            }
        }

        .empty-state {
            text-align: center;
            padding: 80px 20px;
            background: white;
            border-radius: $radius-lg;
            box-shadow: $shadow-md;
            border: 1px solid $border-light;
            .empty-icon {
                font-size: 64px;
                color: $text-muted;
                margin-bottom: 16px;
            }
            p {
                color: $text-secondary;
                font-size: 16px;
                margin: 0;
            }
        }
        .comments-list {
            display: flex;
            flex-direction: column;
            gap: 24px;
            margin-bottom: 40px;
            .comment-item {
                background: white;
                border-radius: $radius-lg;
                padding: 24px;
                box-shadow: $shadow-md;
                border: 1px solid $border-light;
                transition: all $transition-normal;
                display: flex;
                gap: 16px;
                &:hover {
                    transform: translateY(-2px);
                    box-shadow: $shadow-lg;
                    border-color: rgba($accent-color, 0.2);
                }
                .comment-avatar {
                    width: 48px;
                    height: 48px;
                    border-radius: 50%;
                    overflow: hidden;
                    flex-shrink: 0;
                    img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                    }
                }
                .comment-content {
                    flex: 1;
                    .comment-header {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 12px;
                        .comment-nickname {
                            font-weight: $font-semibold;
                            color: $text-primary;
                            font-size: 16px;
                        }
                        .comment-date {
                            color: $text-muted;
                            font-size: 12px;
                        }
                    }
                    .comment-text {
                        color: $text-secondary;
                        line-height: 1.6;
                        margin-bottom: 16px;
                        font-size: 14px;
                    }
                    .comment-actions {
                        display: flex;
                        gap: 12px;
                        align-items: center;
                        
                        .like-btn {
                            display: flex;
                            align-items: center;
                            gap: 6px;
                            padding: 6px 12px;
                            border-radius: $radius-sm;
                            border: 1px solid $border-color;
                            background: white;
                            color: $text-secondary;
                            cursor: pointer;
                            transition: all $transition-normal;
                            font-size: 12px;
                            &:hover {
                                border-color: $accent-color;
                                color: $accent-color;
                                background: rgba($accent-color, 0.05);
                            }
                            &.liked {
                                border-color: $accent-color;
                                color: $accent-color;
                                background: rgba($accent-color, 0.1);
                            }
                        }
                        
                        .reply-btn {
                            display: flex;
                            align-items: center;
                            gap: 6px;
                            padding: 6px 12px;
                            border-radius: $radius-sm;
                            border: 1px solid $border-color;
                            background: white;
                            color: $text-secondary;
                            cursor: pointer;
                            transition: all $transition-normal;
                            font-size: 12px;
                            &:hover {
                                border-color: $accent-color;
                                color: $accent-color;
                                background: rgba($accent-color, 0.05);
                            }
                        }
                    }
                }
            }
        }
        .pagination-wrapper {
            display: flex;
            justify-content: center;
            padding: 20px 0;
             :deep(.el-pagination) {
                .el-pager li {
                    border-radius: $radius-md;
                    transition: all $transition-normal;
                    &:hover {
                        background-color: rgba($accent-color, 0.1);
                        color: $accent-color;
                    }
                    &.is-active {
                        background-color: $accent-color;
                        color: white;
                    }
                }
                .btn-prev,
                .btn-next {
                    border-radius: $radius-md;
                    transition: all $transition-normal;
                    &:hover {
                        background-color: rgba($accent-color, 0.1);
                        color: $accent-color;
                    }
                }
            }
        }
    }
}

// 动画效果
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

// 响应式设计
@media (max-width: 1024px) {
    .hero-section {
        padding: 60px 0 40px;
        .hero-title {
            font-size: 2.5rem;
        }
        .hero-subtitle {
            font-size: 1.1rem;
        }
    }
    .stats-section .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    .comment-form-section .form-container {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 15px;
    }
    .hero-section {
        padding: 40px 0 30px;
        .hero-title {
            font-size: 2rem;
        }
        .hero-subtitle {
            font-size: 1rem;
        }
    }
    .stats-section {
        margin-bottom: 40px;
        .stats-grid {
            grid-template-columns: 1fr;
            gap: 16px;
        }
        .stat-card {
            padding: 24px 20px;
            .stat-icon {
                width: 50px;
                height: 50px;
                font-size: 20px;
            }
            .stat-content .stat-number {
                font-size: 1.5rem;
            }
        }
    }
    .comment-form-section {
        margin-bottom: 40px;
        .form-container {
            padding: 24px;
            .form-header .user-avatar {
                width: 60px;
                height: 60px;
                font-size: 24px;
            }
        }
    }
    .comments-section .comments-container .comments-list .comment-item {
        padding: 20px;
        .comment-avatar {
            width: 40px;
            height: 40px;
            font-size: 16px;
        }
    }
}

@media (max-width: 480px) {
    .hero-section {
        .hero-title {
            font-size: 1.75rem;
        }
        .hero-subtitle {
            font-size: 0.9rem;
        }
    }
    .comment-form-section .form-container {
        padding: 20px;
    }
    .comments-section .comments-container .comments-list .comment-item {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        .comment-header {
            flex-direction: column;
            gap: 8px;
        }
    }
}